import { useNavigate } from "react-router-dom"

// 路由路径常量
export const ROUTES = {
  LOGIN: "/login",
  DASHBOARD: "/dashboard",
  CUSTOMERS: "/customers",
  EVENTS: "/events",
  STAFF: "/staff",
  SETTINGS: "/settings"
}
// 创建路由跳转工具函数
// 路由跳转Hook
export const useAppNavigate = () => {
  const navigate = useNavigate()

  return {
    navigate,
    toLogin: () => navigate(ROUTES.LOGIN),
    toDashboard: () => navigate(ROUTES.DASHBOARD),
    toCustomers: () => navigate(ROUTES.CUSTOMERS),
    toEvents: () => navigate(ROUTES.EVENTS),
    toStaff: () => navigate(ROUTES.STAFF),
    toSettings: () => navigate(ROUTES.SETTINGS),
    back: () => navigate(-1),
    forward: () => navigate(1)
  }
}